home *** CD-ROM | disk | FTP | other *** search
/ Download Now 8 / Download Now V8.iso / Program / InternetTools / ApacheWebServer1.3.6 / apache_1_3_6_win32.exe / _SETUP.1 / os.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-03-07  |  3.8 KB  |  124 lines

  1. #ifndef APACHE_OS_H
  2. #define APACHE_OS_H
  3.  
  4. #define PLATFORM "Win32"
  5.  
  6. /*
  7.  * This file in included in all Apache source code. It contains definitions
  8.  * of facilities available on _this_ operating system (HAVE_* macros),
  9.  * and prototypes of OS specific functions defined in os.c
  10.  */
  11.  
  12. /* temporarily replace crypt */
  13. /* char *crypt(const char *pw, const char *salt); */
  14. #define crypt(buf,salt)        (buf)
  15.  
  16. /* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for
  17.    chdir() */
  18. #include <direct.h>
  19.  
  20. #define STATUS
  21. #define WIN32_LEAN_AND_MEAN
  22. #ifndef STRICT
  23.  #define STRICT
  24. #endif
  25. #define CASE_BLIND_FILESYSTEM
  26. #define NO_WRITEV
  27. #define NO_SETSID
  28. #define NO_USE_SIGACTION
  29. #define NO_TIMES
  30. #define NO_GETTIMEOFDAY
  31. //#define NEED_PROCESS_H    although we do, this is specially handled in ap_config.h
  32. #define USE_LONGJMP
  33. #define HAVE_MMAP
  34. #define USE_MMAP_SCOREBOARD
  35. #define MULTITHREAD
  36. #define HAVE_CANONICAL_FILENAME
  37. #define HAVE_DRIVE_LETTERS
  38. typedef int uid_t;
  39. typedef int gid_t;
  40. typedef int pid_t;
  41. typedef int mode_t;
  42. typedef char * caddr_t;
  43.  
  44. /*
  45. Define export types. API_EXPORT_NONSTD is a nasty hack to avoid having to declare
  46. every configuration function as __stdcall.
  47. */
  48.  
  49. #ifdef SHARED_MODULE
  50. # define API_VAR_EXPORT        __declspec(dllimport)
  51. # define API_EXPORT(type)    __declspec(dllimport) type __stdcall
  52. # define API_EXPORT_NONSTD(type)    __declspec(dllimport) type
  53. #else
  54. # define API_VAR_EXPORT        __declspec(dllexport)
  55. # define API_EXPORT(type)    __declspec(dllexport) type __stdcall
  56. # define API_EXPORT_NONSTD(type)    __declspec(dllexport) type
  57. #endif
  58. #define MODULE_VAR_EXPORT   __declspec(dllexport)
  59.  
  60. #define strcasecmp(s1, s2) stricmp(s1, s2)
  61. #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
  62. #define lstat(x, y) stat(x, y)
  63. #define S_ISLNK(m) (0)
  64. #define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG)
  65. #ifndef S_ISDIR
  66. #define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR)
  67. #endif
  68. #ifndef S_ISREG
  69. #define S_ISREG(m)      (((m)&(S_IFREG)) == (S_IFREG))
  70. #endif
  71. #define STDIN_FILENO  0
  72. #define STDOUT_FILENO 1
  73. #define STDERR_FILENO 2
  74. #define JMP_BUF jmp_buf
  75. #define sleep(t) Sleep(t*1000)
  76. #define O_CREAT _O_CREAT
  77. #define O_RDWR _O_RDWR
  78. #define SIGPIPE 17
  79. /* Seems Windows is not a subgenius */
  80. #define NO_SLACK
  81. #include <stddef.h>
  82.  
  83. #define NO_OTHER_CHILD
  84. #define NO_RELIABLE_PIPED_LOGS
  85.  
  86. __inline int ap_os_is_path_absolute(const char *file)
  87. {
  88.   /* For now, just do the same check that http_request.c and mod_alias.c
  89.    * do. 
  90.    */
  91.   return file[0] == '/' || file[1] == ':';
  92. }
  93.  
  94. #define stat(f,ps)  os_stat(f,ps)
  95. API_EXPORT(int) os_stat(const char *szPath,struct stat *pStat);
  96.  
  97. API_EXPORT(int) os_strftime(char *s, size_t max, const char *format, const struct tm *tm);
  98.  
  99. #define _spawnv(mode,cmdname,argv)        os_spawnv(mode,cmdname,argv)
  100. #define spawnv(mode,cmdname,argv)        os_spawnv(mode,cmdname,argv)
  101. API_EXPORT(int) os_spawnv(int mode,const char *cmdname,const char *const *argv);
  102. #define _spawnve(mode,cmdname,argv,envp)    os_spawnve(mode,cmdname,argv,envp)
  103. #define spawnve(mode,cmdname,argv,envp)        os_spawnve(mode,cmdname,argv,envp)
  104. API_EXPORT(int) os_spawnve(int mode,const char *cmdname,const char *const *argv,const char *const *envp);
  105. #define _spawnle                os_spawnle
  106. #define spawnle                    os_spawnle
  107. API_EXPORT(int) os_spawnle(int mode,const char *cmdname,...);
  108.  
  109. /* OS-dependent filename routines in util_win32.c */
  110.  
  111. API_EXPORT(int) ap_os_is_filename_valid(const char *file);
  112.  
  113. /* Abstractions for dealing with shared object files (DLLs on Win32).
  114.  * These are used by mod_so.c
  115.  */
  116. #define ap_os_dso_handle_t  HINSTANCE
  117. #define ap_os_dso_init()
  118. #define ap_os_dso_load(l)   LoadLibraryEx(l, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
  119. #define ap_os_dso_unload(l) FreeLibrary(l)
  120. #define ap_os_dso_sym(h,s)  GetProcAddress(h,s)
  121. #define ap_os_dso_error()   ""    /* for now */
  122.  
  123. #endif   /* ! APACHE_OS_H */
  124.